<!-- 通报modal -->
<template>
  <a-modal title="备注" :width="400" :maskClosable="false" :visible="visible" @cancel="visible = false">
    <a slot="footer">
      <a-button @click="visible = false">取消</a-button>
      <a-button @click="handleSubmit">确定</a-button>

    </a>
    <div>
      <a-form :form="form">
        <a-form-item v-bind="formItemLayout1" label="选择年份">
          <a-select showSearch optionFilterProp="children" v-decorator="[
        'year',
        { rules: [{ required: true, message: '请选择支付周期!' }] },
    ]">
            <a-select-option v-for="(item, index) in yeaList" :key="item.value" :value="item.value">{{
        item.label }}</a-select-option>
          </a-select>

        </a-form-item>
        <a-form-item v-bind="formItemLayout1" label="选择季度">
          <a-select showSearch optionFilterProp="children" v-decorator="[
        'index',
        { rules: [{ required: true, message: '请选择支付周期!' }] },
    ]">
            <a-select-option v-for="(item, index) in indexList" :key="item.value" :value="item.value">{{
        item.label }}</a-select-option>
          </a-select>

        </a-form-item>
      </a-form>
    </div>

  </a-modal>
</template>

<script>

export default {
  //import引入的组件需要注入到对象中才能使用
  components: {},
  props: {

  },
  data () {
    //这里存放数据
    return {
      remark: '',
      action: "add",
      visible: false,
      formItemLayout1: {
        labelCol: {
          xs: { span: 8 },
          sm: { span: 8 }
        },
        wrapperCol: {
          xs: { span: 16 },
          sm: { span: 16 }
        }
      },
      form: this.$form.createForm(this),
      yeaList: [],
      indexList: [{
        value: 1,
        label: '第一季度'
      }, {
        value: 2,
        label: '第二季度'
      }, {
        value: 3,
        label: '第三季度'
      }, {
        value: 4,
        label: '第四季度'
      }]
    };
  },
  //监听属性 类似于data概念
  computed: {},
  //监控data中的数据变化
  watch: {},
  //生命周期 - 创建完成（可以访问当前this实例）
  created () {
    for (let i = 0; i < 11; i++) {
      this.yeaList.push({
        value: 2025 + i,
        label: 2025 + i

      })
    }

  },
  //生命周期 - 挂载完成（可以访问DOM元素）
  mounted () { },
  //方法集合
  methods: {
    view () {
      this.remark = ''
      this.visible = true;

    },

    closeModal () {
      this.remark = ''
      this.visible = false;
    },


    handleSubmit () {
      let _this = this
      _this.form.validateFields((err, values) => {
        if (!err) {
          let params = {
            ...values,

          };
          _this.$emit("save", { ...params });
        }
      });

    },
  },
};
</script>
<style lang="less" scoped>
</style>
